import http from "./http.js";
import config from "@/config/index.config.js";

/* 
 * 系统
 */

// 用户登录
export const postLogin = (data) => http.POST(`${config.baseUrl}/member/login`, data);
// 判断用户是否登录
export const ifLogin = (data) => http.GET(`${config.baseUrl}/member/ifLogin`, data);
//获取字典表数据
export const getDictByType = (data) => http.GET(`${config.baseUrl}/dict/getDictByType`, data);

/* 
 * 查询店铺及商品
 */
//获取店铺列表
export const getStoreList = (data) => http.GET(`${config.baseUrl}/plat/store/list`, data);
//获取商品列表
export const getProdList = (data) => http.GET(`${config.baseUrl}/pms/product/prodList`, data);
//获取分类列表
export const getProdCategoryList = (data) => http.GET(`${config.baseUrl}/pms/category/list`, data);
//获取店铺详情
export const getStoreInfo = (data) => http.GET(`${config.baseUrl}/plat/store/` + data);
//保存商品
export const saveProduct = (data) => http.POST(`${config.baseUrl}/pms/product`, data);
//保存分类
export const saveCategory = (data) => http.POST(`${config.baseUrl}/pms/category`, data);
//查询商品详情
export const getProductInfo = (data) => http.GET(`${config.baseUrl}/pms/product/` + data);

//保存爱好
export const saveHonors = (data) => http.POST(`${config.baseUrl}/member/saveHonors`, data);

/* 
 * 圈子
 */

//查询当前会员的圈子
export const getMemCircle = (data) => http.GET(`${config.baseUrl}/circle/getMemCircle`, data);
//保存圈子
export const saveCircle = (data) => http.POST(`${config.baseUrl}/circle/saveCircle`, data);
//加入圈子
export const joinCircle = (data) => http.POST(`${config.baseUrl}/memberCircle/joinCircle`, data);
//退出圈子
export const exitCircle = (data) => http.POST(`${config.baseUrl}/memberCircle/exitCircle`, data);

/* 
 * 场子
 */
//查询圈中的场子
export const getCirSpace = (data) => http.GET(`${config.baseUrl}/space/getCirSpace`, data);
//查询场子详情
export const getSpaceInfo = (data) => http.GET(`${config.baseUrl}/space/getSpaceInfo`, data);
//保存场子
export const saveSpace = (data) => http.POST(`${config.baseUrl}/space/saveSpace`, data);
//加入场子
export const joinSpace = (data) => http.POST(`${config.baseUrl}/memberSpace/joinSpace`, data);
//退出场子
export const exitSpace = (data) => http.POST(`${config.baseUrl}/memberSpace/exitSpace`, data);

/* 
 * 评论
 */
//查询场子的评论
export const getSpaceComment = (data) => http.GET(`${config.baseUrl}/comment/getSpaceComment`, data);

/* 
 * 道友记
 */
//查询个人相关道友记
export const getNotes = (data) => http.GET(`${config.baseUrl}/friendNote/getNoteList`, data);
//保存道友记
export const saveNote = (data) => http.POST(`${config.baseUrl}/friendNote/saveNote`, data);
//点赞
export const saveAssist = (data) => http.POST(`${config.baseUrl}/assistRecord/saveAssist`, data);
//查询其他会员的圈子
export const getOtherMemCircle = (data) => http.GET(`${config.baseUrl}/circle/getOtherMemCircle`, data);